// pages/list/list.js
import {baseApi} from '../../../utils/util.js';
Page({
  data: {
    'openid':'',
    'visitorName':'',
    'visitorIdcard':'',
    'visitorPhone':'',
    'visitedIdcard':'',
    'visitedName':'',
    'visitedPhone':'',
    'visitedDept':'商务部',
    'etaDate':'2025-01-01',
    'etaTime':'09:01',
    'eta':'',
    'visitedDays':1,
    'carNum':'',
    'reason':'商务访问',
    'deptList':[],
    'reasonList':[],
    'staffList ':[]
  },
  imageError: function(e) {
    console.log('image3发生error事件，携带值为', e.detail.errMsg)
  },
  onLoad(options) {
    const id = decodeURIComponent(options.id);
    console.log(id)
    this.data.appointmentId = id;
    var that = this;
    console.log('appointmentId:', id); // 输出: Name: 示例名称
    wx.request({
      url:  baseApi() + '/app/getVisitorAppointment?id='+id,
      method: 'GET',
      success(res){
        console.log(JSON.stringify(res));
        var data = res.data.data;
        console.log(JSON.stringify(data));
        that.setData(data);
      }
    })
  }
})